// To parse this JSON data, do
//
//     final tagRelationModel = tagRelationModelFromJson(jsonString);

import 'dart:convert';

TagRelationModel tagRelationModelFromJson(String str) =>
    TagRelationModel.fromJson(json.decode(str));

String tagRelationModelToJson(TagRelationModel data) =>
    json.encode(data.toJson());

class TagRelationModel {
  TagRelationModel({
    this.id,
    this.tagId,
    this.userId,
    this.entityType,
    this.entityId,
    this.artistId,
    this.createTime,
    this.updateTime,
    this.name,
    this.createUserId,
  });

  int id;
  int tagId;
  int userId;
  String entityType;
  int entityId;
  int artistId;
  DateTime createTime;
  DateTime updateTime;
  String name;
  int createUserId;

  factory TagRelationModel.fromJson(Map<String, dynamic> json) =>
      TagRelationModel(
        id: json["id"],
        tagId: json["tagId"],
        userId: json["userId"],
        entityType: json["entityType"],
        entityId: json["entityId"],
        artistId: json["artistId"],
        createTime: DateTime.parse(json["createTime"]),
        updateTime: DateTime.parse(json["updateTime"]),
        name: json["name"],
        createUserId: json["createUserId"],
      );

  Map<String, dynamic> toJson() => {
        "id": id,
        "tagId": tagId,
        "userId": userId,
        "entityType": entityType,
        "entityId": entityId,
        "artistId": artistId,
        "createTime": createTime.toIso8601String(),
        "updateTime": updateTime.toIso8601String(),
        "name": name,
        "createUserId": createUserId,
      };
}
